﻿using System;
using System.Runtime.Serialization;

namespace Unity.String.Exceptions
{
    [Serializable]
    public class NestedStringBuilderCreationException : InvalidOperationException
    {
        protected internal NestedStringBuilderCreationException()
        { }
        protected internal NestedStringBuilderCreationException(string typeName, string message = "")
            : base($"A nested call with `notNested: true`, or Either You forgot to call {typeName}.Dispose() of in the past.{message}")
        {
        }

        protected internal NestedStringBuilderCreationException(string message, Exception innerException) : base(message, innerException)
        {
        }

        protected NestedStringBuilderCreationException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }

    }
}
